home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
UTILITIE
/
CPU_MEMO
/
1648.ZIP
/
TESS-P.ARC
/
TESS.TP4
next >
Wrap
Text File
|
1988-10-02
|
20KB
|
426 lines
{****************************************************************************
* TESS.TP4 -- constants and RECORD structures for TP4 programs
***************************************************************************}
{*******************************< TESS.TP4 >*********************************
* *
* Turbo Pascal 4.0 Include File for TesSeRact *
* ------------------------------------------- *
* *
* TesSeRact(TM) -- A Library of Routines for Creating Ram-Resident (TSR) *
* programs for the IBM PC and compatible Personal *
* Computers. *
* *
* The software, documentation and source code are: *
* *
* Copyright (C) 1986, 1987, 1988 Tesseract Development Team *
* All Rights Reserved *
* *
*************************************************************************CR*}
{**
This product supports the TesSeRact(TM) Standard for Ram-Resident
Program Communication. For information about TesSeRact, contact the
TesSeRact Development Team at:
TesSeRact Development Team
c/o Chip Rabinowitz
2084 Woodlawn Avenue
Glenside, PA 19038
1-215-884-3373
Compuserve: 70731,20
MCIMAIL: 315-5415
This MCIMAIL Account has been provided to the TesSeRact Development
Team by Borland International, Inc. The TesSeRact Development Team is
in no way associated with Borland International, Inc. TesSeRact is a
trademark of the TesSeRact Development Team.
**}
{**
***************************************************************************
Copyright Notice
***************************************************************************
This document, other accompanying written and disk-based notes and
specifications, and all referenced and related program files, demonstration
code and object modules accompanying this document are copyrighted by the
TesSeRact Development Team. The copyright owner hereby licenses you to:
use the software; make as many copies of the software and documentation as
you wish; give exact copies of the original to anyone; and distribute the
software and documentation in its unmodified form via electronic means.
There is no charge for any of the above.
You are specifically prohibited from charging, or requesting donations, for
any such copies, however made. Exceptions may be granted to organizations
which charge a small fee for materials, handling, postage and general
overhead. NO ORGANIZATION IS AUTHORIZED TO CHARGE ANY AMOUNT FOR
DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION UNDER ANY OTHER CONDITIONS.
Organizations which charge a fee for distribution of any and all TesSeRact
materials, except as noted above or with the express, written consent of
the TesSeRact Development Team, will be considered in violation of this
copyright, and will be prosecuted to the full extent of the law.
In addition, you are specifically prohibited from making any modifications
to the TesSeRact Library Routines and/or documentation, unless you have a
license for the use of the source code. Under no circumstances is the
copyright notice embedded in the TesSeRact code to be modified or removed.
This is not free software. This license allows you to use this software
without charge for a period of 30 days. In order to include this software
as part of any product, either commercial, shareware, freeware, or public
domain, registration is required. TesSeRact may not be included in any
product for any use without registration. Any such use of the TesSeRact
product are in violation of federal copyright laws, and will be prosecuted.
No copy of the software may be distributed or given away without this
accompanying documentation; this notice must not be removed.
***************************************************************************
Warranty
***************************************************************************
There is no warranty of any kind associated with this software, and the
copyright owner is not liable for damages of any kind. By using this
software, you agree to this. Every effort has been made by the TesSeRact
Development Team to make this product bug-free. However, the nature of
software development is that it is impossible to guarantee bug-free
software.
In the event a verifiable bug is found, the TesSeRact Development Team will
make every attempt to repair the bug as soon as possible.
***************************************************************************
Acknowledgements
***************************************************************************
Grateful appreciation is expressed to CompuServe Information Service, the
IBM Software Forums and their Sysops, and Computer Language Magazine, for
providing us with the means to accomplish the development of TesSeRact.
Without their gracious assistance, TesSeRact could never have come into
existence.
And let's not forget Anne Marie, who suffered through the long evenings and
nights spent getting this product ready.
***************************************************************************
The TesSeRact Development Team:
***************************************************************************
Team Leader: Chip Rabinowitz
Developers: Lane Ferris
Kim Kokkonen
Jim Kyle
Neil J. Rubenking
Barry Simon
Rick Wilson
Contributors: Thomas Brandenborg
Chris Dunford
John Friend
Mark Horvatich
John Hensley
Advisors: Robert Bierman
David Intersimone
Rick Kraus
David Moskowitz
Gary Saxer
***************************************************************************
**}
{* Stores interrupt vector information for TesSeRact use *}
type
TsrIntTable = RECORD
OldVector : pointer; {* Old Interrupt Vector *}
IntNumber : byte; {* Interrupt Number *}
NewVector : word; {* offset of new vector *}
END;
{* User structure for defining additional hotkeys *}
type
ExtraHot = RECORD
HotKey : byte; {* hotkey to check for *}
ShiftState : byte; {* shift state for this hot key *}
FlagByte : byte; {* flag value to use *}
{* MAY NOT BE ZERO!!! *}
END;
{* TesSeRact internal data *}
type
TsrData = RECORD
RevLvl : byte; {* Revision Level of TESS Lib *}
PopupType : byte; {* Type of popup in effect *}
WasInt8 : byte; {* An Interrupt 08h occurred *}
WasInt13 : byte; {* An Interrupt 13h occurred *}
IntFlags : byte; {* Which interrupts are active *}
SoftFlags : byte; {* Which soft ints are active *}
DosVersion : byte; {* current major revision of DOS *}
waitcount : byte; {* Count to wait before popping up *}
InDosFlag : pointer; {* Pointer to DOS INDOS flag *}
DosCritErr : pointer; {* Pointer to DOS Critical Error *}
UserPSP : word; {* PSP segment of user program *}
User28PSP : word; {* PSP segment of user program *}
UserDTA : pointer; {* DTA of interrupted program *}
User28DTA : pointer; {* DTA of interrupted program *}
UserSS : word; {* Stack segment of user program *}
UserSP : word; {* Stack pointer of user program *}
User28SS : word; {* Stack segment of user program *}
User28SP : word; {* Stack pointer of user program *}
UserInt24 : pointer; {* pointer to use INT 24 handler *}
SavedInt9 : pointer; {* storage for additional INT9 *}
OldExtErr : array[0..2] of word;
{* storage for old DOS 3 extended *}
{* error information *}
OldBreak : byte; {* Old Break Setting *}
OldVerify : byte; {* Old Verify Setting *}
InWord4 : byte; {* flag to indicate in WORD 4.0 *}
WasWord4 : byte; {* word 4 special popup flag *}
NewKbdFlag : byte; {* Enhanced Keyboard Call in use *}
Word4Delay : byte; {* Delay for Word 4 *}
Int8 : TsrIntTable; {* Interrupt vector tables *}
Int9 : TsrIntTable;
Int13 : TsrIntTable;
Int16 : TsrIntTable;
Int1C : TsrIntTable;
Int21 : TsrIntTable;
Int28 : TsrIntTable;
Int2F : TsrIntTable;
Int1B : TsrIntTable;
Int23 : TsrIntTable;
Int24 : TsrIntTable;
END;
DataPtr = ^TsrData;
{* TesSeRact data for individual TSR *}
type
TsrParms = RECORD
IdCode : array[0..7] of char; { Unique TSR Id String }
IdNum : word; { Unique TSR Id Number }
FuncFlags : longint; { Bit map of supported functions }
HotKey : byte; { Hotkey for this TSR }
ShiftState : byte; { ShiftState for this TSR }
HotKeyFlag : byte; { which hotkey is in use }
ExtraHotCnt : byte; {number of extra hotkeys to use }
ExtraHotKeys : pointer; { Pointer to hotkey structures }
TsrStatus : word; { Current TSR Status Flags }
TsrPSP : word; { TSR's PSP Segment }
TsrDTA : pointer; { Pointer to TSR's DTA region }
TsrDSeg : word; { TSR's Default Data Segment }
PopupStack : pointer; { Pointer to Popup Stack Area }
BackStack : pointer; { Pointer to Background Stack }
END;
ParmPtr = ^TsrParms;
const { for HotKeys }
TSRHOT_A = $001e;
TSRHOT_B = $0030;
TSRHOT_C = $002e;
TSRHOT_D = $0020;
TSRHOT_E = $0012;
TSRHOT_F = $0021;
TSRHOT_G = $0022;
TSRHOT_H = $0023;
TSRHOT_I = $0017;
TSRHOT_J = $0024;
TSRHOT_K = $0025;
TSRHOT_L = $0026;
TSRHOT_M = $0032;
TSRHOT_N = $0031;
TSRHOT_O = $0018;
TSRHOT_P = $0019;
TSRHOT_Q = $0010;
TSRHOT_R = $0013;
TSRHOT_S = $001f;
TSRHOT_T = $0014;
TSRHOT_U = $0016;
TSRHOT_V = $002f;
TSRHOT_W = $0011;
TSRHOT_X = $002d;
TSRHOT_Y = $0015;
TSRHOT_Z = $002c;
TSRHOT_0 = $000b;
TSRHOT_1 = $0002;
TSRHOT_2 = $0003;
TSRHOT_3 = $0004;
TSRHOT_4 = $0005;
TSRHOT_5 = $0006;
TSRHOT_6 = $0007;
TSRHOT_7 = $0008;
TSRHOT_8 = $0009;
TSRHOT_9 = $000a;
TSRHOT_F1 = $003b;
TSRHOT_F2 = $003c;
TSRHOT_F3 = $003d;
TSRHOT_F4 = $003e;
TSRHOT_F5 = $003f;
TSRHOT_F6 = $0040;
TSRHOT_F7 = $0041;
TSRHOT_F8 = $0042;
TSRHOT_F9 = $0043;
TSRHOT_F10 = $0044;
TSRHOT_F11 = $0057; { not usable with all systems }
TSRHOT_F12 = $0058; { not usable with all systems }
{ for ShiftState }
TSRPOPRSHIFT = $0001;
TSRPOPLSHIFT = $0002;
TSRPOPCTRL = $0004;
TSRPOPALT = $0008;
{ for TSRFLAGS }
TSRUSEPOPUP = $0010;
TSRUSEBACK = $0020;
TSRUSETIMER = $0040;
TSRUSEUSER = $0100;
NOPOPGRAPH = $1000;
NOPOPCOMMAND = $2000;
{ for TsrStatus flags }
HOTKEYON = $0001; {* hot key pressed *}
SHIFTSON = $0002; {* shift states match *}
TSRACTIVE = $0004; {* tsr is running in foreground *}
INT28ACTIVE = $0008; {* INT28 routine is running *}
POPUPSET = $0010; {* popup resident routine installed*}
BACKSET = $0020; {* background routine installed *}
TIMERSET = $0040; {* timer procedure installed *}
EXTRAHOTSET = $0080; {* extra hot keys installed *}
USERPROCON = $0100; {* User-defined procedure installed*}
TSRENABLED = $0200; {* TSR currently enabled *}
TSRRELEASED = $0400; {* TSR has been released *}
EXTRAINT24 = $0800; {* User installed replacement INT24*}
{ for IntFlags and SoftFlags}
ININT13 = $04; {* Interrupt 13 is currently active*}
ININT21 = $08; {* Interrupt 21 is currently active*}
ININT16 = $10; {* Interrupt 16 is currently active*}
ININT28 = $20; {* Interrupt 28 is currently active*}
ININT08 = $40; {* Interrupt 08 is currently active*}
ININT1C = $80; {* Interrupt 1C is currently active*}
{ Keyboard Stuffing Speeds }
STUFF_SLOW = 0; {* Stuff key when buffer is empty *}
STUFF_MED = 1; {* Stuff up to four keys per tick *}
STUFF_FAST = 2; {* Full buffer on every tick *}
function TsDoInit(
HotKey, { one of the HOTKEY constants }
ShiftState, { one of the ShiftState constants }
TSRFlags, { one of the Flags constants }
MemoryTop : word { amount of RAM to keep resident }
) : word; { returns ONLY if TesSeRact can't install; then is $FFFF }
procedure TsSetStack(
var PopUpStack, { stack for use by PopUp routine }
BackGroundStack { stack for use by BackGround routine }
);
procedure TessBeep; { calls TesSeRact's error_beep routine }
function TsCheckResident(
var IDStr, { 8-byte-plus-nul ASCIIZ ID String for TSR }
IDNum { word where TSR-handle ID number will be stored }
) : word; { use BEFORE DoInit; returns $FFFF if already loaded }
function TsGetParms(
TsrIdNum : word { TSR-handle of one to be enabled }
) : ParmPtr; { NIL if IdNum invalid, else points to TsrParms }
function TsCheckHotkey(
HotKey : word { key scan code from constants above }
) : word; { $FFFF if conflict, anything else indicates OK }
function TsSetUser24(
TsrIdNum : word; { TSR-handle of one to be enabled }
UserCritErrProc : pointer { pointer to user's procedure }
) : integer; { zero if successful, nonzero if not }
function TsEnable(
TsrIdNum : word { TSR-handle of one to be enabled }
) : word; {zero means success; non-zero means invalid ID num }
function TsDisable(
TsrIdNum : word { TSR-handle of one to be disabled }
) : word; {zero means success; non-zero means invalid ID num }
function TsRelease(
TsrIdNum : word { TSR-handle of one to be released }
) : word; {zero means success; non-zero means invalid ID num }
function TsRestart(
TsrIdNum : word { TSR-handle of one to be re-started }
) : word; { zero successful, NZ if bad TSR number }
function TsGetStat(
TsrIdNum : word { TSR-handle of one to be checked }
) : word; { returns current status-word of specified TSR }
function TsSetStat(
TsrIdNum : word; { TSR-handle of one to be changed }
NewStatus : word { new status word to be plugged in }
) : word; {zero means success; non-zero means invalid ID num }
function TsGetPopType(
TsrIdNum : word { TSR-handle of one to be checked }
) : word; { zero if invoked from Timer, NZ if background }
function TsCallUserProc(
TsrIdNum : word; { TSR-handle of one to be called }
UserPtr : pointer { points to user-defined data or code }
) : word; {zero means success; non-zero means invalid ID num }
function TsStuffKeyboard(
TsrIdNum : word; { TSR-handle of one to be called }
KbdPtr : pointer; { points to keys to stuff into buffer }
KbdLen : word; { number of keystrokes to stuff }
Speed : word { 0=SLOW, 1=MEDIUM, 2=FAST }
) : word; {zero means success; non-zero means invalid ID num }
function TsTriggerPop(
TsrIdNum : word { TSR-handle of one to be checked }
) : word; { always zero }
function TsTriggerBack(
TsrIdNum : word { TSR-handle of one to be checked }
) : word; { always zero }
procedure TsVerify2F;
procedure TsRestore2F;
function TsSetExtraHot(
TsrIdNum : word; { TSR-handle of one to be called }
Count : byte; { number of extra hotkeys to use }
ExtraKeys : pointer { points to structures of extra hotkeys}
) : word; { zero successful, NZ if bad TSR number }
function TsGetData(
TsrIdNum : word { TSR-handle of one to get data }
) : DataPtr; { NIL if IdNum invalid, else points to TsrData }
procedure TsSetAdrTP4(
ProcAdr : pointer;
Index : integer
);
{ This procedure exists only in the TP4 version; it is used to }
{ set the TS pointers to permit popup of your own routines. }
{ During initialization of the unit, all six pointers are set }
{ to a FAR RET within the unit; your code must reset those you }
{ want to use, via "TsSetAdrTP4( @TsrMain, 2 );" etc. The index}
{ codes to use are: }
{ 0 = your timer procedure, executed 18.2 times/second }
{ 1 = your background procedure, done if check is TRUE }
{ 2 = your main pop-up procedure, done when hotkey is hit }
{ 3 = your background-check function, checked when safe }
{ 4 = your user-defined procedure; see TESS.H for details }
{ 5 = your Initialization/Cleanup procedure; see TESS.H }